var reducer = function(state,action){
	switch(action.type){
		case "CHANGETITLE":
			return Object.assign({},state,{
				headerTitle:action.title
			})
		case "ASIDE_TOGGLE":
			return Object.assign({},state,{
				isToggle:!state.isToggle
			})
		case "GETSECTION1":
			return Object.assign({},state,{
				getMainData1:action.data
			})
		case "GETSECTION2":
			return Object.assign({},state,{
				getMainData2:action.data
			})
		case "GETNOWPLAYDATA":
			return Object.assign({},state,{
				getNowPlayData1:action.data
			})
		case "GETWillPLAYDATA":
			return Object.assign({},state,{
				getWillPlayData:action.data
			})
		case "GETCINEMA":
			return Object.assign({},state,{
				cinemaData:action.data
			})
		case "LOADPAGE":
			return Object.assign({},state,{
				loadPageData:action.idNum
			})
		case "GETDETAILDATA":
			return Object.assign({},state,{
				detailData:action.data
			})
		case "GETUSERDATA":
			console.log("reducer:"+action.user);
			return Object.assign({},state,{ 
				userMsg:action.user
			})
		case "BACKTOP":
			return Object.assign({},state,{
				scrollNum:action.data
			})
		default:
			return state;
	}
}

export default reducer;